﻿using Shinva.Variables.Models;
using Shinva.Variables.Type.combination;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;
using System.Xml.Linq;

namespace Shinva.PLCModel.Models
{
  public  class PlcDB
    {

        //静态变量列表
        public PlcStruct StaticStruct { get; set; } = new PlcStruct() { Name = "Static" };

        /// <summary>
        /// 这是接口变量表
        /// </summary>
        public NormalVariableTable InterfaceVariableTable { get; set; } = new NormalVariableTable();

        /// <summary>
        /// 编程语言，默认为LAD梯形图
        /// </summary>
        public ProgrammingLanguage ProgrammingLanguage { get; set; } = ProgrammingLanguage.DB;


        /// <summary>
        /// 程序名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 程序编号
        /// </summary>
        public int Number { get; set; }
        public PlcDB( int number, string name)
        {
            InterfaceVariableTable.AddMember(StaticStruct);
            //构建程序信息
            Number = number;
            Name = name + "[" + "DB" + number + "]";
        }

    }
}
